
// https://www.nowcoder.com/questionTerminal/433c0c6a1e604a4795291d9cd7a60c7a

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
using namespace std;

int main()
{
    int n = 0;
    while (cin >> n)
    {
        vector<string> list;
        vector<bool> flag(n, true);
        while (n--)
        {
            string str;
            cin >> str;
            list.push_back(str);
        }
        sort(list.begin(), list.end());

        for (size_t i = 0; i < list.size() - 1; ++i)
        {
            if (list[i] == list[i + 1])
                flag[i] = false;
            if (list[i].size() < list[i + 1].size()
                && list[i] == list[i + 1].substr(0, list[i].size())
                && list[i + 1][list[i].size()] == '/')
                flag[i] = false;
        }

        for (size_t i = 0; i < list.size(); ++i)
        {
            if (flag[i])
                cout << "mkdir -p " << list[i] << endl;
        }
        cout << endl;
    }
    return 0;
}